package com.z8888q.zerodays.rewrite;

import java.text.DateFormatSymbols;
import java.util.Calendar;

import android.app.DatePickerDialog;
import android.content.Context;
import android.text.format.DateFormat;
import android.widget.DatePicker;


public class LunarDatePickerDialog extends DatePickerDialog{
	
    private final Calendar mCalendar;
    private final java.text.DateFormat mDateFormat;
    private final String[] mWeekDays;

	public LunarDatePickerDialog(Context context, OnDateSetListener callBack,
			int year, int monthOfYear, int dayOfMonth) {
		super(context, callBack, year, monthOfYear, dayOfMonth);
		// TODO Auto-generated constructor stub
        DateFormatSymbols symbols = new DateFormatSymbols();
        mWeekDays = symbols.getShortWeekdays();
        
        mDateFormat = DateFormat.getMediumDateFormat(context);
        mCalendar = Calendar.getInstance();
	}

	public LunarDatePickerDialog(Context context, int theme,
			OnDateSetListener callBack, int year, int monthOfYear,
			int dayOfMonth) {
		super(context, theme, callBack, year, monthOfYear, dayOfMonth);
		// TODO Auto-generated constructor stub
        DateFormatSymbols symbols = new DateFormatSymbols();
        mWeekDays = symbols.getShortWeekdays();
        
        mDateFormat = DateFormat.getMediumDateFormat(context);
        mCalendar = Calendar.getInstance();
	}
	
    @Override
    public void onDateChanged(DatePicker view, int year,
            int month, int day) {
    	super.onDateChanged(view, year, month, day);
//        updateTitle(year, month, day);
    	updateTitle2(year, month, day);
    }
    
    private void updateTitle2(int year, int month, int day) {
    	setTitle("123456");
/*        mCalendar.set(Calendar.YEAR, year);
        mCalendar.set(Calendar.MONTH, month);
        mCalendar.set(Calendar.DAY_OF_MONTH, day);
        String weekday = mWeekDays[mCalendar.get(Calendar.DAY_OF_WEEK)];
        setTitle(weekday + ",@,, " + mDateFormat.format(mCalendar.getTime()));*/
    }
	
    private void updateTitle(int year, int month, int day) {
//    	super.updateTitle(year, month, day);
    	
    	
/*        mCalendar.set(Calendar.YEAR, year);
        mCalendar.set(Calendar.MONTH, month);
        mCalendar.set(Calendar.DAY_OF_MONTH, day);
        String weekday = mWeekDays[mCalendar.get(Calendar.DAY_OF_WEEK)];
        setTitle(weekday + ",@,, " + mDateFormat.format(mCalendar.getTime()));*/
    }
	
}
